Update AVB hash header image_size to match unpacked original_image_size.#9830
Update AVB hash header image_size to match unpacked original_image_size.#9830kousu wants to merge 1 commit into
Conversation
360b9ce to
44363da
Compare
44363da to
fe7c726
Compare
|
Here's my proof that this works: BuildMy build env is ArchLinux with these packages (some of them from the AUR) as recommended: plus this helper script to avoid polluting Arch's packages with the forked NDK: setup_ondk.shmksdkI'm on fe7c726 Build (~15 minutes, maybe longer): Let's double-check it compiled the expected version + git commit in: 👍 InstallNotice that the app version is fe7c726 as expected:
Patch
Get the image back out so we can flash it. Flash🌟 Flashing gets past the dreaded " (bootloader) Preflash validation failed" 🐦⬛ 🐈⬛ 🏴 ☠️ 🌟 TestAnd it comes up cleanly with the right version,
and it's rooted 🎉
|
This follows topjohnwu#9830 with recomputing the AVB hash. Apparently few (no?) devices actualy respect this hash in the wild at the moment, but it is good to be prepared. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This follows topjohnwu#9830 with recomputing the AVB hash. Apparently few (no?) devices actualy respect this hash in the wild at the moment, but it is good to be prepared. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This follows topjohnwu#9830 by recomputing the AVB hash. Apparently few (no?) devices actually respect this hash in the wild at the moment, but it's good to be prepared. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates MagiskBoot’s AVB vbmeta handling during repack so the vbmeta hash descriptor’s image_size is synchronized with the repacked AOSP image size, addressing fastboot “Preflash validation failed” on some devices (e.g., Motorola).
Changes:
- Add AVB descriptor tag/struct definitions and a small descriptor-iteration helper on
AvbVBMetaImageHeader. - During
repack, update AVB footer fields and additionally patch the vbmeta hash descriptorimage_sizeto match the neworiginal_image_size.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| native/src/boot/bootimg.hpp | Adds AVB descriptor types plus a range/iterator helper to traverse vbmeta descriptors. |
| native/src/boot/bootimg.cpp | Uses the new descriptor iteration to locate the hash descriptor and update image_size during repack. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ef7c484 to
81a674f
Compare
This follows topjohnwu#9830 by recomputing the AVB hash. Apparently few (no?) devices actually respect this hash in the wild at the moment, but it's good to be prepared. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
I've addressed co-pilot's reviews. They were a couple useful safety checks but nothing that changed the main direction of the logic. You could ask it for another round if you like 😽 |
Fixes topjohnwu#8389 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
81a674f to
e9c673e
Compare
|
@yujincheng08 I'm wondering what's the usual timeline for getting a human review on PRs. I'd like to see this go in so that I can feel confident about updating my phone again and I'm sure so would everyone in #8389. Just an ETA so we can set our expectations and attention right would be great. |





Fixes #8389